<?php
Yii::import('Cms.components.widgets.BaseCmsWidgetLayout');
class GenericListDefaultLayout extends BaseCmsWidgetLayout {
    
    public function getViewPath(){
        return 'Cms.components.widgets.layouts.views.GenericListDefault';
    }
    
    /**
    * The view template used to render a single item
    * @return string
    */
    protected function getItemView() {
        $modelPath = $this->owner->getContentModel();
        if (empty($modelPath))
            return '';
            
        list($module,$folder,$model) = explode('.', $modelPath);
        return "{$module}.views.admin.{$model}._view";
    }
    
    

    protected $settingParams = array(
            'PageSize' => array(  
                'rules' => array('numerical' => array('max' => 50, 'min' => 1)),
                'visible' => true,
                'value' => Settings::PAGE_SIZE,
            ),
            'PagerStyle' => array(  
                'type' => 'dropdownlist',
                'items' => array(0 => 'Next and Previous', 1 => 'Show page numbers'),
                'htmlOptions' => array(),
                'visible' => true,
                'value' => 1,
            ),
            'ShowResultCoutner' => array(  
                'type' => 'checkbox',
                'htmlOptions' => array('value' => 1),
                'visible' => true,
                'value' => 1
            ),
//            'name' => array(
//                'type' => CHtml::function or Yii path to a widget. 
                            //If CHtml function then the function name is in lower case. 
                            //Suffixes like 'field' or 'button' must be removed
//                'rules' => array('rule name - see Yii rule classes' => array(config)),
//                'items' => array(key => value) //used for dropDownList of similar CHtml functions
//                'htmlOptions' => array()
//                // following items are used to setup the widget setting info while installing  
//                'label'           => 'Short friendly param name'
//                'value'           => 'default value'
//                'description'     => 'Full description'
//                'setting_group'   => 'General Settings'
//                'ordering'        => 0
//                'visible'         => 0
//            ),
    );        
}
?>
